package com.doctor.ui.consulting.professorList.view;

import android.view.View;
import android.widget.TextView;

import com.doctor.base.BaseFragment;
import com.doctor.constants.CodeHelper;
import com.doctor.ui.R;
import com.doctor.utils.callback.DataChangedListener;

/**
 * 专家列表界面
 * Created by chemin on 2017/3/12 19:47.
 */

public class ProfessorListFrag extends BaseFragment implements View.OnClickListener {

    private TextView mTvCardRecord;
    private TextView mTvConsultation;
    private TextView mSearchOffice;
    private TextView mSearchProvence;
    private DataChangedListener mListener;


    public void setDatachangListener(DataChangedListener listener){
        this.mListener=listener;
    }
    @Override
    protected int getLayoutId() {
        return R.layout.fragment_professor_layout;
    }

    @Override
    protected void initView(View view) {
        mTvCardRecord = (TextView) view.findViewById(R.id.element_tv_card_record);
        mTvConsultation = (TextView) view.findViewById(R.id.element_tv_consultation_menu);
        mSearchOffice = (TextView) view.findViewById(R.id.professor_tv_search_office);
        mSearchProvence = (TextView) view.findViewById(R.id.professor_tv_search_provence);
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void addListener() {
        mTvCardRecord.setOnClickListener(this);
        mTvConsultation.setOnClickListener(this);
    }

    @Override
    protected void setData() {

    }

    @Override
    public void onClick(View v) {
        if (v!=null){
            switch (v.getId()){
                case R.id.element_tv_card_record://跳转到会诊单记录界面
                    if (mListener!=null){
                        mListener.dataChanged(CodeHelper.CONSULTATION_CARD_RECORD_FRAGMENT,null);
                    }
                    break;
                case R.id.element_tv_consultation_menu://跳转到会诊列表
                    if (mListener!=null){
                        mListener.dataChanged(CodeHelper.CONSULTATION_MENU,null);
                    }
                    break;
                case R.id.professor_tv_search_office:

                    break;
                case R.id.professor_tv_search_provence:

                    break;
            }
        }
    }
}
